const path = require("path");

module.exports = {
  performance: {
    hints: false
  },
  resolve: {
    extensions: ["*", '.ts', ".js", ".vue", ".json"],
    alias: {
      "@": path.resolve(__dirname, "../"),
    }
  },
  module: {
    rules: [
      {
        test: /\.mjs$/,
        include: /node_modules/,
        type: "javascript/auto"
      },
      {
        test: /\.ejs$/,
        use: [

          {
            loader: 'ejs-loader',
          },
        ],
        exclude: /node_modules/,
      },
      {
        test: /\.(js)$/,
        use: [

          {
            loader: "babel-loader",
            options: {
              presets: [['es2015', {loose: true}]],
              cacheDirectory: true,
              // plugins: ['transform-runtime', 'transform-async-to-generator'],
            },
          },
        ],
        exclude: /node_modules/,
      },
      {
        test: /\.vue$/,
        use: ["vue-loader"],
      },
      {
        test: /\.css$/,
        use: [
          'style-loader', 'css-loader',
        ],
      },
      {
        test: /\.scss$/,
        use: [
          'style-loader', 'css-loader', 'sass-loader',
        ],
      },
      {
        test: /\.ycss$/,
        use: [
          'css-loader', 'sass-loader',
        ],
      },
      {
        test: /\.less$/,
        use: ["css-loader", "less-loader"]
      },
      {
        test: /\.(png|svg|jpg|gif)$/,
        use: [
          {
            loader: "file-loader",
            options: { outputPath: "img" }
          }
        ]
      },
      {
        test: /\.(woff|woff2|eot|ttf|otf)$/,
        use: [
          {
            loader: "file-loader",
            options: { outputPath: "font" }
          }
        ]
      }
    ]
  },
  plugins: [
  ]
};
